package com.cmc.cloud.cmclink.doc.api.document;

import com.cmc.cloud.cmclink.doc.api.document.req.si.BlnoInfoDto;
import com.cmc.cloud.cmclink.doc.api.document.req.si.BlnoVslvoyBaseDto;
import com.cmc.cloud.cmclink.doc.constant.DocApiConstants;
import com.cmes.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;

/**
 * 订舱拆分合并
 *
 * @author codegen
 */
@FeignClient(name = DocApiConstants.NAME)
@Tag(name = "RPC - 服务 提单更正 Change")
public interface SiChangeApi {

    String PREFIX = DocApiConstants.PREFIX + "/si";

    /**
     * 创建SI更改记录
     * @param blnoInfoDto 更正DTO
     * @return void
     */
    @PostMapping(PREFIX + "/createSiChange")
    @Operation(summary = "提单更正创建")
    CommonResult<Void> createSiChange(@Valid @RequestBody BlnoInfoDto blnoInfoDto);


    /**
     * 创建SI更改记录
     * @param id 提单主表id
     * @return void
     */
    @PostMapping(PREFIX + "/checkSiChange/{id}")
    @Operation(summary = "校验提单更正信息")
    CommonResult<Boolean> checkSiChange(@PathVariable("id") Long id);


    /**
     * 船期修改校验
     * @param id 提单主表id
     * @return void
     */
    @PostMapping(PREFIX + "/change_vessel_schedule/check/{id}")
    @Operation(summary = "船期修改校验")
    CommonResult<Boolean> checkVesselScheduleChange(@PathVariable("id") Long id);


    /**
     * 申请人撤回更正申请
     *
     * @param id 提单主表id
     * @return void
     */
    @PostMapping(PREFIX + "/cancelNotice/{id}")
    @Operation(summary = "撤回更正申请")
    CommonResult<Void> cancelNotice(@PathVariable("id") Long id);

    /**
     * 提单船期修改
     * @param blnoInfoDto 参数
     * @return void
     */
    @PostMapping(PREFIX + "/createSiVesselChange")
    @Operation(summary = "提单船期修改")
    CommonResult<Void> createSiVesselChange(@Valid @RequestBody BlnoInfoDto blnoInfoDto);


    /**
     * 根据提单号查询提单的船期信息
     * @param blnoId 参数
     * @return void
     */
    @GetMapping(PREFIX + "/getBlnoVolvy/{blnoId}")
    @Operation(summary = "根据提单号查询提单的船期信息")
    CommonResult<List<BlnoVslvoyBaseDto>> getBlnoVolovy(@PathVariable("blnoId")Long blnoId);


}
